<template>
  <form>
    用户名:
    <input type="text" name="username" v-model="from.username" /><br />
    密 码:
    <input type="text" name="password" v-model="from.password" />
  </form>
</template>

<script>
export default {
  data() {
    return {
      from: {
        username: '',
        password: '',
      },
    }
  },
  methods: {
    submit() {
      console.log(this.from);
      this.from = {}
    },
  },
}
</script>

<style scoped></style>
